{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f1b01583",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "111\n"
     ]
    }
   ],
   "source": [
    "def a():\n",
    "    print(111)\n",
    "a()\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f220a44a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<function __main__.a()>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5b32fa89",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<function a at 0x000001B2AB697D30>\n"
     ]
    }
   ],
   "source": [
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ef97e648",
   "metadata": {},
   "outputs": [],
   "source": [
    "def b():\n",
    "    print('adaafsagag')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "460a64c7",
   "metadata": {},
   "outputs": [],
   "source": [
    "def c(aa):\n",
    "    aa()\n",
    "    print(aa)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "e681a747",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "111\n",
      "<function a at 0x000001B2AB697D30>\n"
     ]
    }
   ],
   "source": [
    "c(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "d5cb38fd",
   "metadata": {},
   "outputs": [],
   "source": [
    "def pos(x,y,z):\n",
    "    print(x)\n",
    "    print(y)\n",
    "    print(z)\n",
    "    \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1f8ff118",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "b64fadd4",
   "metadata": {},
   "outputs": [],
   "source": [
    "m = 1\n",
    "n = 2\n",
    "b = 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0a0bcd9f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "2\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "pos(m,n,b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "68449149",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "1\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "pos(n,m,b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c7bb9ed0",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "1\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "pos(x=n,y=m,z=b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "81efcdd2",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "pos() missing 1 required positional argument: 'z'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_8768/374480447.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mpos\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mm\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mn\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: pos() missing 1 required positional argument: 'z'"
     ]
    }
   ],
   "source": [
    "pos(m,n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "a4990ea7",
   "metadata": {},
   "outputs": [],
   "source": [
    "def a(b =1,c=2):\n",
    "    print(b)\n",
    "    print(c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "2779e623",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "2\n"
     ]
    }
   ],
   "source": [
    "a()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "a1126ef9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10\n",
      "1\n",
      "2\n"
     ]
    }
   ],
   "source": [
    "def a(aa,b =1,c=2):\n",
    "    print(aa)\n",
    "    print(b)\n",
    "    print(c)\n",
    "    \n",
    "    \n",
    "a(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "a7d4251a",
   "metadata": {},
   "outputs": [],
   "source": [
    "def aa(*args):\n",
    "    print(args)\n",
    "    print(type(args))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "4af03ebd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1, 2, 3, 4, 5)\n",
      "<class 'tuple'>\n"
     ]
    }
   ],
   "source": [
    "aa(1,2,3,4,5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "1f025b5a",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "aa() got an unexpected keyword argument 'a'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_8768/2693461711.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0maa\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: aa() got an unexpected keyword argument 'a'"
     ]
    }
   ],
   "source": [
    "aa(1,2,a=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "3347a0f3",
   "metadata": {},
   "outputs": [],
   "source": [
    "def bb(**kwards):\n",
    "    print(kwards)\n",
    "    print(type(kwards))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "a73a745e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'a': 1, 'b': 2, 'c': 3}\n",
      "<class 'dict'>\n"
     ]
    }
   ],
   "source": [
    "bb(a=1,b=2,c=3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "3f17c09b",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = list(range(10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "c4bc5c41",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "e5a68689",
   "metadata": {},
   "outputs": [],
   "source": [
    "b = tuple(range(10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "f66ff89d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "7c3cb6ca",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "((0, 1, 2, 3, 4, 5, 6, 7, 8, 9),)\n",
      "<class 'tuple'>\n"
     ]
    }
   ],
   "source": [
    "aa(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "817a653c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def aa(*args):\n",
    "    print(args)\n",
    "    for i in args:\n",
    "        print(i)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "12340e3c",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'int' object is not iterable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_8768/414947594.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0maa\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_8768/2695197305.py\u001b[0m in \u001b[0;36maa\u001b[1;34m(*args)\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0maa\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m     \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m         \u001b[1;32mfor\u001b[0m \u001b[0my\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      4\u001b[0m             \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[0maa\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'int' object is not iterable"
     ]
    }
   ],
   "source": [
    "aa(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "977bbfa2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1, 2)\n",
      "1\n",
      "2\n"
     ]
    }
   ],
   "source": [
    "aa(m,n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "db2c240f",
   "metadata": {},
   "outputs": [],
   "source": [
    "def aa(*args):\n",
    "    print(args)\n",
    "    print(args[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "5bbb1483",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1, 2)\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "aa(m,n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "35f46207",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "((1,23,))\n",
    "a[1][]\n",
    "(1,23)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "552a3ce5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "06f34e47",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1,)\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "aa(m)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "a803bfa4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "ee0dcce1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n",
      "5\n",
      "6\n",
      "7\n",
      "8\n",
      "9\n"
     ]
    }
   ],
   "source": [
    "def aaa(a):\n",
    "    for i in a:\n",
    "        print(i)\n",
    "aaa(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "b1cd5698",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n",
      "5\n",
      "6\n",
      "7\n",
      "8\n",
      "9\n"
     ]
    }
   ],
   "source": [
    "def aa(*args):\n",
    "    for i in args:\n",
    "        for y in i:\n",
    "            print(y)\n",
    "aa(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "9587766f",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 1\n",
    "b = 2\n",
    "c = 3\n",
    "d = 4\n",
    "f = 5\n",
    "g = 6\n",
    "h = 7\n",
    "i = 8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "ee7e601e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "2\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "pos(a,b,c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "cf6a9296",
   "metadata": {},
   "outputs": [],
   "source": [
    "def pos(x,y,z,x1,x2,x3,x4,x5,x6,x7):\n",
    "    print(111111)\n",
    "    \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "6fd316dd",
   "metadata": {},
   "outputs": [],
   "source": [
    "def pos(*args):\n",
    "    if len(args) == 8:\n",
    "        for i in args:\n",
    "            print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "b9f56dda",
   "metadata": {},
   "outputs": [],
   "source": [
    "pos(a,b,c,d,f,g,h,i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "fc290007",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "5e3400e5",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "111111\n"
     ]
    }
   ],
   "source": [
    "pos(*a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "26ad0625",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "27be4bc4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
